﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using System.Data;
using System.Data.SqlClient;

namespace DataAccess
{
    public class QLDiemThi
    {
        public static DataTable xemdiemthi(string masinhvien)
        {
            return DataAccess.ExeStoredWithParamToDataTable("QLDiemThi", "@MaSinhVien", masinhvien);
        }
        public static string update(string masinhvien, float diemthilan1, float diemthilan2)
        {
            ketnoi kn = new ketnoi();
            string kq = kn.update("update DiemThi set DiemThiLan1='" + diemthilan1 + "',DiemThiLan2='" + diemthilan2 + "' where MaSinhVien='" + masinhvien + "'");
            return kq;
        }
        public static string updatediemlan1(string masv,string mamonhoc,float diemtb)
        {
           return DataAccess.ExeStoredToString("DiemThi_updatediemlan1", "@MaSinhVien", masv, "@MaMonHoc", mamonhoc, "@DiemTrungBinh", diemtb);
        }
        public static string updatediemlan2(string masv, string mamonhoc, float diemtb, float diemthilan2)
        {
            return DataAccess.ExeStoredToString("DiemThi_updatediemlan2", "@MaSinhVien", masv, "@MaMonHoc", mamonhoc, "@DiemTrungBinh", diemtb, "@DiemThiLan1", diemthilan2);
        }
        public static string LayDiemTrungBinh(string mamonhoc,string masv)
        {
            return DataAccess.ExeStoredToString("LayDiemTrungBinh", "@MaMonHoc", mamonhoc, "@MaSinhVien", masv);
        }
        public static string UpdateDiemTinchi(string masv, string mamonhoc, string diem)
        {
            return DataAccess.ExeStoredToString("UpdateDiemTinChi", "@MaSinhVien", mamonhoc, "@MaMonHoc", mamonhoc, "@DiemTinChi", diem);
        }
    }
}

